home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / libraris / sregexp9 / part01 / sregexp.h < prev    next >
C/C++ Source or Header  |  1991-05-18  |  2KB  |  50 lines

  1.  
  2. /* This is used for COMPILING sregexp.library, it should not be included
  3.   if you just USE the library.    See sregexpbase.h */
  4.  
  5. #include <stddef.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8. #include <ctype.h>
  9. #include <clib/exec_protos.h>
  10. #include <clib/dos_protos.h>
  11. #include <libraries/dosextens.h>
  12. #include "sregexpbase.h"
  13.  
  14. #define TRUE    1
  15. #define FALSE    0
  16.  
  17.  
  18. #define MEM_ERROR    ERROR_NO_FREE_STORE    /* report no mem */
  19. #define ILLEGAL_ERR    ERROR_INVALID_COMPONENT_NAME   /* bad sregexp */
  20.  
  21.  
  22. /* some handy fingersaving macros. */
  23. #define realen(a)       (((a)->sre_Flag&(SRF_REPEAT|SRF_NOT))?0:(a)->sre_MinLen)
  24. #define isfixed(s)      (((s)->sre_Flag&(SRF_REPEAT|SRF_NOT|SRF_FIXLEN))==SRF_FIXLEN)
  25. #define matchset(s,c)   ((s)->sre_Data.setchar[(c)/8] & 1 << (c)%8)
  26. #define getmem(a)       AllocMem(a,0)
  27.  
  28. static struct SregExp *     parsesub(char **, char);
  29. static struct SregExp *     makesum(struct SregList *, int);
  30. static struct SregExp *     makeor(struct SregList *,int);
  31. static struct SregExp *     parseone(char **, char);
  32. static char            onechar(char **, char);
  33. static char *            makeset(char **);
  34. static int            matchsum(struct SregExp *[], int, char *, int, int);
  35. static void            report(int);
  36. static struct SpathNode *   makespathnode(BPTR, char *, struct SregList *);
  37. static void            freespathnode(struct SpathNode *);
  38. static struct SregList *    parsepath(char *);
  39.  
  40. extern struct SregExp *     parsesregexp(char *);
  41. extern void            freesregexp(struct SregExp *);
  42. extern int            matchsregexp(char *, struct SregExp *, int);
  43. extern int            matchnsregexp(char *, struct SregExp *, int, int);
  44. extern int            iswild(char *);
  45. extern struct SpathInfo *   anchorpath(char *, char *);
  46. extern int            nextfile(struct SpathInfo *, char *, int, int);
  47. extern int            buildpath(struct SpathInfo *, char *, int);
  48. extern void            freespathinfo(struct SpathInfo *);
  49.  
  50.